package com.lk.ii.service.impl;

import java.util.List;
import com.lk.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lk.ii.mapper.IiSolutionMapper;
import com.lk.ii.domain.IiSolution;
import com.lk.ii.service.IIiSolutionService;
import com.lk.common.core.text.Convert;

/**
 * 解决方案Service业务层处理
 * 
 * @author lk
 * @date 2021-02-22
 */
@Service
public class IiSolutionServiceImpl implements IIiSolutionService 
{
    @Autowired
    private IiSolutionMapper iiSolutionMapper;

    @Override
    public List<IiSolution> getSolutionPageList(Long pageSize, Long offset)
    {
        return iiSolutionMapper.getSolutionPageList(pageSize, offset);
    }

    /**
     * 查询解决方案
     * 
     * @param id 解决方案ID
     * @return 解决方案
     */
    @Override
    public IiSolution selectIiSolutionById(Long id)
    {
        return iiSolutionMapper.selectIiSolutionById(id);
    }

    /**
     * 查询解决方案列表
     * 
     * @param iiSolution 解决方案
     * @return 解决方案
     */
    @Override
    public List<IiSolution> selectIiSolutionList(IiSolution iiSolution)
    {
        return iiSolutionMapper.selectIiSolutionList(iiSolution);
    }

    /**
     * 新增解决方案
     * 
     * @param iiSolution 解决方案
     * @return 结果
     */
    @Override
    public int insertIiSolution(IiSolution iiSolution)
    {
        iiSolution.setCreateTime(DateUtils.getNowDate());
        return iiSolutionMapper.insertIiSolution(iiSolution);
    }

    /**
     * 修改解决方案
     * 
     * @param iiSolution 解决方案
     * @return 结果
     */
    @Override
    public int updateIiSolution(IiSolution iiSolution)
    {
        iiSolution.setUpdateTime(DateUtils.getNowDate());
        return iiSolutionMapper.updateIiSolution(iiSolution);
    }

    /**
     * 删除解决方案对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteIiSolutionByIds(String ids)
    {
        return iiSolutionMapper.deleteIiSolutionByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除解决方案信息
     * 
     * @param id 解决方案ID
     * @return 结果
     */
    @Override
    public int deleteIiSolutionById(Long id)
    {
        return iiSolutionMapper.deleteIiSolutionById(id);
    }
}
